<?php

use Yaf\Session;
use Yaf\Registry;


class BookingController extends ApiBaseController{

    /**
     * @SWG\Post(
     *     path="/admin/booking/create",
     *     tags={"订购信息"},
     *     summary="创建订购信息接口",
     *     description="",
     *     @SWG\Parameter(
     *          name="Authorization",
     *          description="Authorization 登录接口返回的jwt字段的值",
     *          in="header",
     *          required=true,
     *          type="string"
     *     ),
     *     @SWG\Parameter(
     *          name="sn",
     *          description="订购信息编号",
     *          in="formData",
     *          required=true,
     *          type="string"
     *     ),
     *     @SWG\Parameter(
     *          name="trade_order_sn",
     *          description="上游订单号",
     *          in="formData",
     *          required=true,
     *          type="string"
     *     ),
     *     @SWG\Parameter(
     *          name="member_id",
     *          description="会员编号",
     *          in="formData",
     *          required=true,
     *          type="string"
     *     ),
     *     @SWG\Parameter(
     *          name="product_id",
     *          description="商品编号",
     *          in="formData",
     *          required=true,
     *          type="string"
     *     ),
     *     @SWG\Parameter(
     *          name="sku_id",
     *          description="阿里巴巴skuId",
     *          in="formData",
     *          required=true,
     *          type="string"
     *     ),
     *     @SWG\Parameter(
     *          name="address_id",
     *          description="收货地址",
     *          in="formData",
     *          required=true,
     *          type="string"
     *     ),
     *     @SWG\Parameter(
     *          name="num",
     *          description="商品数量",
     *          in="formData",
     *          required=true,
     *          type="string"
     *     ),
     *     @SWG\Parameter(
     *          name="price",
     *          description="价格",
     *          in="formData",
     *          required=true,
     *          type="string"
     *     ),
     *     @SWG\Parameter(
     *          name="stats",
     *          description="状态(0为未支付,1为已支付,2为发起退款,3为已退款,4为发起退货,5为已退货)",
     *          in="formData",
     *          required=true,
     *          type="string"
     *     ),
     *     @SWG\Parameter(
     *          name="channel",
     *          description="支付通道(0为支付宝,1为微信)",
     *          in="formData",
     *          required=true,
     *          type="string"
     *     ),
     *     @SWG\Parameter(
     *          name="expired_at",
     *          description="过期时间",
     *          in="formData",
     *          required=true,
     *          type="string"
     *     ),
     *     @SWG\Parameter(
     *          name="refund_at",
     *          description="退款发起时间",
     *          in="formData",
     *          required=true,
     *          type="string"
     *     ),
     *     @SWG\Parameter(
     *          name="return_at",
     *          description="退货发起时间",
     *          in="formData",
     *          required=true,
     *          type="string"
     *     ),
     *     @SWG\Parameter(
     *          name="sign",
     *          description="签名",
     *          in="formData",
     *          required=true,
     *          type="string"
     *     ),
     *     @SWG\Response(
     *         response="201",
     *         description="请求成功",
     *         @SWG\Schema(type="object", ref="#/definitions/bookingSingleData")
     *     ),
     *     @SWG\Response(
     *         response="422",
     *         description="创建失败"
     *     ),
     *     @SWG\Response(
     *         response="400",
     *         description="签名不存在或无效签名"
     *     ),
     *     @SWG\Response(
     *         response="401",
     *         description="jwt无效或过期，需要登录"
     *     ),
     *     @SWG\Response(
     *         response="403",
     *         description="无权访问"
     *     ),
     *     @SWG\Response(
     *         response="404",
     *         description="找不到数据"
     *     )
     * )
     */
    public function createAction() {
        $parameters = Registry::get('parameters');
        return $this->_responseJson(['data' => $parameters]);
    }


    /**
     * @SWG\Get(
     *     path="/admin/booking/list",
     *     tags={"订购信息"},
     *     summary="获取订购信息列表数据接口",
     *     @SWG\Parameter(
     *          name="Authorization",
     *          description="Authorization 登录接口返回的jwt字段的值",
     *          in="header",
     *          required=true,
     *          type="string"
     *     ),
     *     @SWG\Parameter(
     *          name="page",
     *          description="页码",
     *          in="query",
     *          required=true,
     *          type="string"
     *     ),
     *     @SWG\Parameter(
     *          name="page_size",
     *          description="每页显示条数",
     *          in="query",
     *          required=true,
     *          type="string"
     *     ),
     *     @SWG\Parameter(
     *          name="sort",
     *          description="排序方式 可选值: desc|asc",
     *          in="query",
     *          required=true,
     *          type="string"
     *     ),
     *     @SWG\Parameter(
     *          name="order",
     *          description="排序字段 可选值: id",
     *          in="query",
     *          required=true,
     *          type="string"
     *     ),
     *     @SWG\Parameter(
     *          name="sign",
     *          description="签名",
     *          in="query",
     *          required=true,
     *          type="string"
     *     ),
     *     @SWG\Response(
     *         response="200",
     *         description="请求成功",
     *         @SWG\Schema(type="object", ref="#/definitions/bookingListData")
     *     ),
     *     @SWG\Response(
     *         response="400",
     *         description="签名不存在或无效签名"
     *     ),
     *     @SWG\Response(
     *         response="401",
     *         description="jwt无效或过期，需要登录"
     *     ),
     *     @SWG\Response(
     *         response="403",
     *         description="无权访问"
     *     ),
     *     @SWG\Response(
     *         response="404",
     *         description="找不到数据"
     *     )
     * )
     */
    public function listAction() {
        $parameters = Registry::get('parameters');
        return $this->_responseJson(['data' => $parameters]);
    }


    /**
     * @SWG\Put(
     *     path="/admin/booking/{id}/edit",
     *     tags={"订购信息"},
     *     summary="编辑订购信息接口",
     *     description="",
     *     @SWG\Parameter(
     *          name="Authorization",
     *          description="Authorization 登录接口返回的jwt字段的值",
     *          in="header",
     *          required=true,
     *          type="string"
     *     ),
     *     @SWG\Parameter(
     *          name="sn",
     *          description="/admin/Booking/list接口返回的id字段的值",
     *          in="path",
     *          required=true,
     *          type="string"
     *     ),
     *     @SWG\Parameter(
     *          name="sn",
     *          description="订购信息编号",
     *          in="formData",
     *          required=false,
     *          type="string"
     *     ),
     *     @SWG\Parameter(
     *          name="trade_order_sn",
     *          description="上游订单号",
     *          in="formData",
     *          required=false,
     *          type="string"
     *     ),
     *     @SWG\Parameter(
     *          name="member_id",
     *          description="会员编号",
     *          in="formData",
     *          required=false,
     *          type="string"
     *     ),
     *     @SWG\Parameter(
     *          name="product_id",
     *          description="商品编号",
     *          in="formData",
     *          required=false,
     *          type="string"
     *     ),
     *     @SWG\Parameter(
     *          name="sku_id",
     *          description="阿里巴巴skuId",
     *          in="formData",
     *          required=false,
     *          type="string"
     *     ),
     *     @SWG\Parameter(
     *          name="address_id",
     *          description="收货地址",
     *          in="formData",
     *          required=false,
     *          type="string"
     *     ),
     *     @SWG\Parameter(
     *          name="num",
     *          description="商品数量",
     *          in="formData",
     *          required=false,
     *          type="string"
     *     ),
     *     @SWG\Parameter(
     *          name="price",
     *          description="价格",
     *          in="formData",
     *          required=false,
     *          type="string"
     *     ),
     *     @SWG\Parameter(
     *          name="stats",
     *          description="状态(0为未支付,1为已支付,2为发起退款,3为已退款,4为发起退货,5为已退货)",
     *          in="formData",
     *          required=false,
     *          type="string"
     *     ),
     *     @SWG\Parameter(
     *          name="channel",
     *          description="支付通道(0为支付宝,1为微信)",
     *          in="formData",
     *          required=false,
     *          type="string"
     *     ),
     *     @SWG\Parameter(
     *          name="expired_at",
     *          description="过期时间",
     *          in="formData",
     *          required=false,
     *          type="string"
     *     ),
     *     @SWG\Parameter(
     *          name="refund_at",
     *          description="退款发起时间",
     *          in="formData",
     *          required=false,
     *          type="string"
     *     ),
     *     @SWG\Parameter(
     *          name="return_at",
     *          description="退货发起时间",
     *          in="formData",
     *          required=false,
     *          type="string"
     *     ),
     *     @SWG\Parameter(
     *          name="sign",
     *          description="签名",
     *          in="formData",
     *          required=true,
     *          type="string"
     *     ),
     *     @SWG\Response(
     *         response="200",
     *         description="请求成功",
     *         @SWG\Schema(type="object", ref="#/definitions/bookingSingleData")
     *     ),
     *     @SWG\Response(
     *         response="422",
     *         description="编辑失败"
     *     ),
     *     @SWG\Response(
     *         response="400",
     *         description="签名不存在或无效签名"
     *     ),
     *     @SWG\Response(
     *         response="401",
     *         description="jwt无效或过期，需要登录"
     *     ),
     *     @SWG\Response(
     *         response="403",
     *         description="无权访问"
     *     ),
     *     @SWG\Response(
     *         response="404",
     *         description="找不到数据"
     *     )
     * )
     */
    public function editAction() {
        $parameters = Registry::get('parameters');
        return $this->_responseJson(['data' => $parameters]);
    }


    /**
     * @SWG\DELETE(
     *     path="/admin/booking/{id}/delete",
     *     tags={"订购信息"},
     *     summary="删除订购信息接口",
     *     description="",
     *     @SWG\Parameter(
     *          name="Authorization",
     *          description="Authorization 登录接口返回的jwt字段的值",
     *          in="header",
     *          required=true,
     *          type="string"
     *     ),
     *     @SWG\Parameter(
     *          name="sn",
     *          description="/admin/Booking/list接口返回的id字段的值",
     *          in="path",
     *          required=true,
     *          type="string"
     *     ),
     *     @SWG\Response(
     *         response="200",
     *         description="删除成功, 没有返回结果"
     *     ),
     *     @SWG\Response(
     *         response="400",
     *         description="签名不存在或无效签名"
     *     ),
     *     @SWG\Response(
     *         response="401",
     *         description="jwt无效或过期，需要登录"
     *     ),
     *     @SWG\Response(
     *         response="403",
     *         description="无权访问"
     *     ),
     *     @SWG\Response(
     *         response="404",
     *         description="找不到数据"
     *     )
     * )
     */
    public function deleteAction() {
        $parameters = Registry::get('parameters');
        return $this->_responseJson(['data' => $parameters]);
    }

}